function [ hasil ] = y_RK3( f, x0, y0, b, h )
%Y_RK3 Summary of this function goes here
%   Menghitung y(b) dengan metode Runge-Kutta orde tiga pada PDB
%   y' = f(x,y); y(x0)=y0
    n = (b - x0)/h; %jumlah langkah
    y = y0;
    x = x0;
    syms a b;
    
    for r = 1 : n
        k1 = h * subs(f, [a b], [x y])
        
        k2 = h * subs(f, [a b], [(x + h / 2) (y + k1 / 2)])
        
        k3 = h * subs(f, [a b], [(x + h) (y - k1 + 2 * k2)])
        
        y = y + (k1 + 4 * k2 + k3) / 6;
        x = x + h;
    end
    hasil = y;
end
